package {
	import flash.display.Sprite;
	import flash.text.TextField;
	
	public class LivesCounter extends Sprite {
		private var lives:uint;
		
		private var text:TextField = new TextField();
		
		public function LivesCounter(startingLives:uint) {
			lives = startingLives;
			
			// Change this when we get graphics
			text.text = startingLives.toString();
			addChild(text);
		}
		
		public function loseLife():void {
			if (lives > 0) --lives;
			text.text = lives.toString();
		}
		
		public function get dead():Boolean {
			return lives == 0;
		}
	}
}